package com.nthink.indicators.controller;

import com.nthink.indicators.pojo.operationindex.dip.AvgDayTop10diagnosis;
import com.nthink.indicators.pojo.operationindex.dip.DipData;
import com.nthink.indicators.service.operationindex.DipService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;
import java.util.List;

/**
 * @author Angus Yu
 * @date 2021-03-31 16:23
 */
@Api(tags = "资产运营")
@RestController
public class DipController {

    @Autowired
    private DipService service;


    @ApiOperation("DIP 评价（医保科）住院时间超过30天出院人数")
    @GetMapping("/getDipData")
    public DipData getDipData(@RequestParam(required = false) Date startTime, @RequestParam(required = false) Date endTime) {
        return service.getDipData(startTime, endTime);
    }

    @ApiOperation("DIP 评价（医保科）病种平均住院日(排名前10病种)")
    @GetMapping("/getArgDayTop10diagnosis")
    @ResponseBody
    public List<AvgDayTop10diagnosis> getArgDayTop10diagnosis(@RequestParam(required = false) Date startTime, @RequestParam(required = false) Date endTime) {
        return service.getAvgDayTop10diagnosis(startTime, endTime);
    }
}
